<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: gold;
            border: 1px solid #000;
            text-align: center;
            line-height: 200px;
            margin: 20px;
        }
        .box-left{
            float: left;
        }
        .box-right{       
            float: right;
        }
    </style>
</head>
<body>
    <div class="box box-left">内容一</div>
    <div class="box box-left">内容二</div>
    <div class="box box-left">内容三</div>
    <div class="box box-right">内容四</div>
    <div class="box box-left">内容五</div>
    <div class="box box-right">内容六</div>
    <div class="box box-left">内容七</div>
    <div class="box box-right">内容八</div>
</body>
</html>